import {createApp} from 'vue'
import router from "./router/index.js";
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import 'animate.css';
import '@/assets/style/element.scss'
import "nprogress/nprogress.css";
import './permission.js'
import '@/assets/iconfont/iconfont.css'
import '@/assets/style/index.scss'
import App from './App.vue'
import store from "@/store/index.js";
import {matchingRoutes} from "@/utils/index.js";

const app = createApp(App)

app.directive('permission', {
    mounted(el, binding) {
        matchingRoutes(store.getters.addRoutes, router.currentRoute.value.path, binding.value[0], el)
    }
})

app.config.globalProperties.$toStringCall = Object.prototype.toString
// 使用 ElementPlus
app.use(ElementPlus, {size: 'small', locale: zhCn})
app.use(router)
app.use(store)
app.mount('#app')
